<template>
  <div>
    <!--已签名金卡协议-->
    <p class="text" v-html="goods.agreement"></p>
    <img width="100%" height="250px" :src="accountelesign.signStr" v-if="haveSign"/>
  </div>
</template>

<script type="text/ecmascript-6">
  import {getSignVipcardDetail} from '../../../../test/unit/http'
  import {Toast} from 'we-vue'

  export default {
    name: 'havesignjinkaxieyi',
    props: {},
    data() {
      return {
        goods: {},
        haveSign: false,
        showType: true,
        accountElesignId: '',
        accountelesign: {}
      };
    },
    methods: {
      getVipcardDetailData(params) {
        getSignVipcardDetail(params).then(res => {
          console.log(res);
          if (res.code == 100) {
            this.goods = res.object.vipcard;
            this.haveSign = res.object.haveSign;
            if (this.haveSign) {
              this.accountelesign = res.object.accountelesign;
            }
          } else {
            Toast.fail(res.info);
          }
        })
      },
    },
    created() {
      let goodsId = this.$route.query.goodsId;
      let accountGoodsId = this.$route.query.accountGoodsId;
      this.getVipcardDetailData({goodsId: goodsId, accountGoodsId: accountGoodsId});
    },
    components: {}
  }
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped lang="less" rel="stylesheet/less">
  .divider {
    background-color: #eee;
    height: 20px;
    width: 100%;
    text-align: left;
    padding: 3px;

    .btn {
      button {
        color: #fff;
        border: none;
        width: calc(35% - 50px);
        margin-left: 30px;
      }

      :last-child {
        background-color: #f9964e;

      }

      :first-child {
        background-color: #ccc;
        margin-right: 20px;
      }
    }
  }

  .title {
    font-size: 20px;
    color: #111;
    font-weight: 700;
    padding: 10px;
  }

  .text {
    font-size: 15px;
    color: #666;
    line-height: 25px;
    text-indent: 30px;
    text-align: left;
    padding: 10px 10px 60px;
  }

  .offer {
    position: fixed;
    bottom: 0;
    width: 100%;
    background-image: linear-gradient(to right, #f9964e, #ff8551);
    height: 50px;
    line-height: 50px;
    color: #fff;
  }
</style>
